//
//  CameraSensor.m
//  UAVClient
//
//  Created by visu4l on 11. 7. 4..
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import "CameraSensor.h"


@implementation CameraSensor

@synthesize controller;
@synthesize picture;

-(id) init{
    controller = [[UIImagePickerController alloc] init];
    controller.delegate = self;
    controller.editing = NO;
    controller.sourceType = UIImagePickerControllerSourceTypeCamera;
    
    return NULL;
}


-(void) imagePickerController:(UIImagePickerController *)picker didFinishPickingImage:(UIImage *)image editingInfo:(NSDictionary *)editingInfo{
    picture = [[UIImage alloc] initWithCGImage:image.CGImage scale:image.scale orientation:image.imageOrientation];
    [[picker parentViewController] dismissModalViewControllerAnimated:YES ];
}

-(void) imagePickerControllerDidCancel:(UIImagePickerController *)picker{
    [picker dismissModalViewControllerAnimated:YES];
}


-(void) dealloc{
    
    [controller release];
    [super dealloc];
}

@end
